#pragma once
#include <unordered_map>
#include <string>
#include <mutex>
using std:: string;
using std:: unordered_map;
using std:: mutex;
class Configuration
{
public:
    Configuration(const Configuration & ) = delete;
    Configuration &operator = (Configuration &) = delete;
    static Configuration *getInstance();
    bool loadConfigData(string filename);
    static void destory();
    string getIp();
    unsigned short getPort();
    string getLogfile();
    string getVedioPath();
    string getDatabase();
    string getLocalhost();
    string getPasssword();
    string getUsername();
    int getThreadNum();
    int getTaskNum();
private:
    unordered_map<string, string> _configData;
    mutex _mux;
    static Configuration *_pInstance;
    void processLine(string & line);


    //私有构造函数
    Configuration(){};
    ~Configuration(){};

};

